package constant

import (
	"errors"
	"github.com/gin-gonic/gin"
)

var (
	AccountIsExist = errors.New("")
)

const (
	ErrorUnknown gin.ErrorType = iota + 10000
	ErrorUnauthorized
	ErrorCodeCredentialInvalid
	ParamsError
	DBError
	AccountPasswordErr
	VerifyCodeErr
	AccountExist
	GuacdError
	HostServerExist
	DeviceIDNotExist
)

// ErrorMap 错误信息字典，固定6位长度，前两位按服务划分，后3位为具体错误类型，还有一位备用
var ErrorMap = map[gin.ErrorType]string{
	ErrorUnknown: "服务端发生了不可预期的错误，请联系开发人员！",
	ParamsError:  "参数不合法，请检查API文档",

	// 账号、密码、认证类错误
	ErrorUnauthorized:          "未认证",
	ErrorCodeCredentialInvalid: "签名认证失败",
	AccountPasswordErr:         "账号密码错误",
	VerifyCodeErr:              "验证码不正确",
	AccountExist:               "账户已经存在",
	GuacdError:                 "guacd 发生不可预期错误",
	HostServerExist:            "主机信息已经存在",
	DeviceIDNotExist:           "设备ID不存在",
}
